package com.tuanzi.loan.web.lazy.wetchat;

import com.tuanzi.loan.business.service.wechat.WechatCustomerMessageService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.wechat.WechatCustomerMessageRequest;
import com.tuanzi.loan.vo.response.wechat.WechatCustomerMessageResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @Author: chenweijun
 * @Date: 2018/9/27 17:38
 * @Description:
 */
public class WechatCustomerMessageLazyDataModel extends LazyDataSessionModel<WechatCustomerMessageRequest, WechatCustomerMessageResponse> {

    private WechatCustomerMessageService wechatCustomerMessageService;

    public WechatCustomerMessageLazyDataModel(WechatCustomerMessageRequest searchRequest, CurrentUserBean session, WechatCustomerMessageService wechatCustomerMessageService) {
        super(searchRequest, session);
        this.wechatCustomerMessageService = wechatCustomerMessageService;
    }

    @Override
    protected Page<WechatCustomerMessageResponse> doLoad0(PageSearcher<WechatCustomerMessageRequest> pageSearcher) {
        return wechatCustomerMessageService.list(pageSearcher);
    }
}
